<?php
	$db=new DB();
	$query ="Select * from reservaciones where Id_Reservacion='{$id}'";
	$r=$db->query($query);
	if($db->total()>0){
		$row=$db->getRow();
		$ResValues= array("{$row[8]}","{$row[7]}","{$row[9]}","{$row[10]}","{$row[11]}","{$row[12]}",
						  "{$row[13]}","{$row[14]}","{$row[15]}","{$row[16]}","{$row[17]}","{$row[1]}","{$row[2]}","{$row[3]}");
	}
	$db->close();
?>
<script language="javascript" src="../js/operadoraLib.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript" src="../js/calendar.js" ></script>
<script type="text/javascript" src="../js/calendar-es.js" language="javascript"></script>
<script type="text/javascript" src="../js/calendar-setup.js" language="javascript"></script>
<style type="text/css">@import url(../css/calendar.css);</style>
<form name="EditRes" method="post" action="ReservacionesV.php">
<input type="hidden" name="editedId" value="<?php echo $id; ?>" />
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
    	<td class="formtitle" colspan="4">Reservaci&oacute;n <?php echo $id; ?></td>
    </tr>
    <tr>
    	<td class="formLabelRes">Titulo Cliente</td>
  <td width="179" class="formInput">
       	<?php echo $ResValues[0];  ?>
        </td>
      <td class="formLabelRes">Nombre Cliente</td>
      <td class="formInput"><?php echo $ResValues[1]; ?></td>
    </tr>
    <tr>
    	<td class="formLabelRes">Hotel</td>
        <td class="formInput" style="white-space:nowrap;">
			<?php 
				$db=new DB();
                $query="Select Nombre from hoteles where Id_Hotel='{$row[2]}'";
                $result=$db->query($query);
                $row3 = $db->getRow();
                echo $row3[0];
				$db->close();
            ?>
        </td>
        <td class="formLabelRes">Destino</td>
        <td class="formInput" style="white-space:nowrap;">
            	<?php
            	$db=new DB();
                $query="Select Nombre_Destino from Destino where Id_Destino='{$row[1]}' and Id_Hotel='{$row[2]}'";
                $result=$db->query($query);
                $row3 = $db->getRow();
                echo $row3[0];
				$db->close();
				?>
        </td>
    </tr>
     <tr>
    	<td class="formLabelRes">Tipo de Habitaci&oacute;n</td>
        <td class="formInput" style="white-space:nowrap;">
        		<?php
            	$db=new DB();
                $query="Select Nombre from tipo_habitacion where Id_Tipo='{$ResValues[13]}'";
                $result=$db->query($query);
                $row3 = $db->getRow();
                echo $row3[0];
                $db->close();
				?>
        </td>
        <td class="formLabelRes">&nbsp;</td>
        <td class="formInput">&nbsp;</td>
    </tr> 
    <tr>
    	<td class="formLabelRes">Fecha Reservaci&oacute;n</td>
        <td class="formInput" style="white-space:nowrap;">
        	<?php echo $ResValues[2]; ?>
        </td>
        <td class="formLabelRes">Fecha limite para agencia</td>
        <td class="formInput">
        	<?php echo $ResValues[3]; ?>
        </td>
    </tr>
    <tr>
    	<td class="formLabelRes">N&deg; Noches</td>
        <td class="formInput"><?php echo $ResValues[10]; ?></td>
    	<td class="formLabelRes">Tipo Pago</td>
        <td class="formInput">
        	<?php
				echo $ResValues[4];
			?>
        </td>
    </tr>
    <tr>
    	<td class="formLabelRes">Costo</td>
        <td class="formInput"><?php echo $ResValues[5]; ?></td>
    	<td class="formLabelRes">Saldo</td>
        <td class="formInput"><?php echo $ResValues[6]; ?></td>
    </tr>
    <tr>
    	<td class="formLabelRes" valign="top">Solicitud Especial</td>
        <td colspan="3" class="formInput">
        	<?php echo $ResValues[7]; ?>
        </td>
    </tr>
    <tr>
    	<td class="formLabelRes">&nbsp;</td>
        <td class="formInput">&nbsp;</td>
        <td class="formLabelRes">Factura</td>
        <td class="formInput">
        	<?php
				echo $ResValues[9];
			?>
        </td>
    </tr>
    <tr>
    	<td colspan="4" align="center">
        	<br />
            <input type="button" name="ActualizarBtn" value="Ok" onClick="parent.location.replace('Disponibilidad.php')" />
        </td>
    </tr>
</table>
</form>